********************************************************************************
/*							CODE INFORMATION

	Project: Central bank communication and house price expectations
	
	Date: 	May 2025
	
	Purpose: Load analysis datasets and output analysis tables

    Inputs: 
	 A. Interest rate information provision experiment: 
	                       1. analysis_data_infor_provision.dta
						   2. analysis_data_infor_provision_descriptive.dta (for descriptive statistic in Appendix)
     B. Non-verbal communication experiment: 					   
						   3. analysis_data_non_verbal.dta

	 C. Hypothetical vignette experiment: 						   
						   4. analysis_data_vignette_main.dta
						   5. analysis_vignette_pooled.dta
						   
     D. Robustness experiments wave:                   
	                       6. analysis_data_robust_wave.dta
	 
    Outputs (in sequence): 
	         Main results: Table 3
	                       Table 4
						   Table 5
						   Table 6
						   Table 7
						   Table 8
						   Table 9
						   
		  Appendix Tables: Table A.1
		                   Table A.2
						   Table A.3
						   Table A.4
						   Table A.5
						   Table A.6
						   Table A.7
						   Table A.8
						   Table A.9
						   Table A.10
						   Table A.11
						   Table A.12
						   Table A.13
						   Table A.14
						   Table A.16				   
						   Table A.17
						   Table A.18					   
*/
********************************************************************************


clear
set more off
pause on

capture log close

//Include your directories to the replication folder below: e.g. /Users/litang/Library/CloudStorage/Dropbox/RCT_Housing_new/data/replication
global sDIR = "INCLUDE DIRECTORY OF THE REPLICATION FOLDER"


cd "$sDIR"

log using "$sDIR/analysis_log", replace
// --------------------------------------------------------------------------------------------------
// -------------------------------------------Main results-------------------------------------------
// --------------------------------------------------------------------------------------------------
use "$sDIR/analysis_data_infor_provision.dta", clear
// -------------------------------------------
// ------------------ Table 1 ----------------
// -------------------------------------------
//       N/A (purely descriptive table)

// -------------------------------------------
// ------------------ Table 2 ----------------
// -------------------------------------------

//       N/A (purely descriptive table)

// -------------------------------------------
// ------------------ Table 3 ----------------
// -------------------------------------------
global ATE_control = "i.Gender i.Employment c.age##c.age i.earn_q i.region i.totalhh i.Children i.Marriage"
//columns 1 and 2
reg diff_House i.group  [pw = wt], r
reg diff_House i.group $ATE_control  [pw = wt], r

//columns 3 and 4
reg diff_House_f i.group  if follow_up == 1 , r
reg diff_House_f i.group $ATE_control if follow_up == 1 , r

// -------------------------------------------
// ---------------- Table 4 ----------------
// -------------------------------------------
global IS_control = "i.Gender i.Employment c.age##c.age i.Income i.colleage i.region totalhh i.Children i.Marriage"
//columns 1 and 2
reg diff_House c.shock_ffr##i.group   [pw=wt] , r
reg diff_House c.shock_ffr##i.group $IS_control   [pw=wt] , r

//columns 3 and 4
reg diff_House_f c.shock_ffr##i.group [pw=wt], r
reg diff_House_f c.shock_ffr##i.group $IS_control [pw=wt], r

use "$sDIR/analysis_data_non_verbal.dta", clear
// -------------------------------------------
// ------------------ Table 5 ----------------
// -------------------------------------------
global ind_contr = "i.gender i.employment c.age##c.age i.income i.education i.region i.child i.mortgage_payment i.ownership"
//column 1
reg diff_house wording voice face $ind_contr, r
//column 2
reg diff_house wording voice face wording#c.information_shock_all voice#c.information_shock_all face#c.information_shock_all information_shock_all $ind_contr, r 
//column 3
reg diff_house_f wording voice face $ind_contr, r
//column 4
reg diff_house_f wording voice face wording#c.information_shock_all voice#c.information_shock_all face#c.information_shock_all information_shock_all $ind_contr, r

// --------------------------------------------------------------
// ----------------------------- Table 6 ---------------------
// --------------------------------------------------------------
reg diff_house wording voice face wording#c.prior_knowledge_channel voice#c.prior_knowledge_channel face#c.prior_knowledge_channel prior_knowledge_channel pre_house post_mortgage post_inf, r
reg diff_house wording voice face wording#c.prior_knowledge_channel voice#c.prior_knowledge_channel face#c.prior_knowledge_channel prior_knowledge_channel pre_house post_mortgage post_inf $ind_contr, r 
reg diff_house_f wording voice face wording#c.prior_knowledge_channel voice#c.prior_knowledge_channel face#c.prior_knowledge_channel prior_knowledge_channel pre_house post_mortgage post_inf_f, r 
reg diff_house_f wording voice face wording#c.prior_knowledge_channel voice#c.prior_knowledge_channel face#c.prior_knowledge_channel prior_knowledge_channel pre_house post_mortgage post_inf_f $ind_contr, r 


// -------------------------------------------
// ------------------ Table 7 ----------------
// ------------------ Panel A ----------------
// --- higher HP is financially harmful ------
// -------------------------------------------
//column 1
reg diff_house script_evaluation_full_aggre voice_evaluation_full_aggre face_evaluation_full_aggre pre_mortgage pre_interest_nov pre_inf $ind_contr if house_better == 1, r

//column 2
reg diff_house script_evaluation_full_aggre c.voice_evaluation_full_aggre c.face_evaluation_full_aggre c.script_evaluation_full_aggre#c.information_shock_all c.voice_evaluation_full_aggre#c.information_shock_all c.face_evaluation_full_aggre#c.information_shock_all c. information_shock_all pre_mortgage pre_interest_nov pre_inf $ind_contr if house_better == 1, r

//column 3
reg diff_house_f script_evaluation_full_aggre voice_evaluation_full_aggre face_evaluation_full_aggre $ind_contr if house_better == 1, r

//column 4
reg diff_house_f script_evaluation_full_aggre c.voice_evaluation_full_aggre c.face_evaluation_full_aggre c.script_evaluation_full_aggre#c.information_shock_all c.voice_evaluation_full_aggre#c.information_shock_all c.face_evaluation_full_aggre#c.information_shock_all c.information_shock_all pre_mortgage pre_interest_nov pre_inf $ind_contr if house_better == 1, r 

// ------------------ Panel B ----------------
// --- higher HP is not financially harmful --
// -------------------------------------------
//column 1
reg diff_house script_evaluation_full_aggre voice_evaluation_full_aggre face_evaluation_full_aggre pre_mortgage pre_interest_nov pre_inf $ind_contr if house_better != 1, r

//column 2
reg diff_house script_evaluation_full_aggre voice_evaluation_full_aggre face_evaluation_full_aggre c.script_evaluation_full_aggre#c.information_shock_all c.voice_evaluation_full_aggre#c.information_shock_all c.face_evaluation_full_aggre#c.information_shock_all c.information_shock_all pre_mortgage pre_interest_nov pre_inf $ind_contr if house_better != 1, r

//column 3
reg diff_house_f script_evaluation_full_aggre voice_evaluation_full_aggre face_evaluation_full_aggre $ind_contr if house_better != 1, r

//column 4
reg diff_house_f script_evaluation_full_aggre c.voice_evaluation_full_aggre c.face_evaluation_full_aggre  c.script_evaluation_full_aggre#c.information_shock_all c.voice_evaluation_full_aggre#c.information_shock_all c.face_evaluation_full_aggre#c.information_shock_all c.information_shock_all pre_mortgage pre_interest_nov pre_inf $ind_contr if house_better != 1, r 


use "$sDIR/analysis_data_vignette_main.dta", clear
// -------------------------------------------
// ------------------ Table 8 ----------------
// -------------------------------------------
global ind_contr = "i.Gender i.Employment c.age##c.age i.earn_q i.Education i.region i.totalhh i.Children i.Ownership "
// ------------------ Panel A --------------------------------
// --- open-ended recall and house price expectation ------
// -----------------------------------------------------------
reg rev_direct P_pos_open P_neg_open  if  nonsense_open == 0 & revision != ., r	
reg rev_direct P_pos_open P_neg_open $ind_contr if  nonsense_open == 0 & revision != ., r
reg revision P_pos_open P_neg_open if  nonsense_open == 0, r	
reg revision P_pos_open P_neg_open $ind_contr if  nonsense_open == 0, r

// ------------------ Panel B --------------------------------
// --- MCQ recall and house price expectation ------
// -----------------------------------------------------------
reg rev_direct P_pos P_neg [pw=wt], r
reg rev_direct P_pos P_neg $ind_contr [pw=wt], r
reg revision P_pos P_neg [pw=wt], r
reg revision P_pos P_neg $ind_contr [pw=wt], r

// -------------------------------------------
// ------------------ Table 9 ----------------
// -------------------------------------------
//column1
reg ex1 i.Mortgage_payment [pw=wt], r
//column 2
reg ex1 i.Mortgage_payment $ind_contr [pw=wt], r
//column 3
probit mec1 i.Mortgage_payment [pw=wt], r
margins, dydx(*) atmeans
//column 4
probit mec1 i.Mortgage_payment $ind_contr [pw=wt], r
margins, dydx(*) atmeans
//column 5
reg revision i.Mortgage_payment [pw=wt], r
//column 6
reg revision i.Mortgage_payment $ind_contr [pw=wt], r


// --------------------------------------------------------------------------------------------------
// -------------------------------------------Appendix Tables ---------------------------------------
// --------------------------------------------------------------------------------------------------

// -------------------------------------------------------------
// --------------------------- Table A.1 -----------------------
// -------------------------------------------------------------
use "$sDIR/analysis_data_infor_provision_descriptive.dta", clear
//Number of observation:
tab group
// -------------------------------------------
// ------------------ Panel A ----------------
// -------------------------------------------
// ------First 4 columns of each row------
tab Gender [aw=wt]
tab Gender [aw=wt] if g == 1
tab Gender [aw=wt] if g == 2
tab Gender [aw=wt] if g == 3
tab Gender [aw=wt] if g == 4

sum age [aw=wt]
sum age [aw=wt] if g == 1
sum age [aw=wt] if g == 2
sum age [aw=wt] if g == 3
sum age [aw=wt] if g == 4

tab above_bachelor [aw=wt]
tab above_bachelor [aw=wt] if g == 1
tab above_bachelor [aw=wt] if g == 2
tab above_bachelor [aw=wt] if g == 3
tab above_bachelor [aw=wt] if g == 4

//here uses tab to show both "Employed" 
tab Employment [aw=wt] 
tab Employment [aw=wt] if g == 1
tab Employment [aw=wt] if g == 2
tab Employment [aw=wt] if g == 3
tab Employment [aw=wt] if g == 4

//here uses tab to show both "HH Income < $90,000 " and "HH Income < $60,000 " rows
// monthly income below $4,999 => annaul Income < $60,000; 
tab Income [aw=wt] 
tab Income [aw=wt] if g == 1
tab Income [aw=wt] if g == 2
tab Income [aw=wt] if g == 3
tab Income [aw=wt] if g == 4

//here shows the mean of total household number
sum totalhh [aw=wt]
sum totalhh [aw=wt] if g == 1
sum totalhh [aw=wt] if g == 2
sum totalhh [aw=wt] if g == 3
sum totalhh [aw=wt] if g == 4

//here shows the distribution of total household number
tab totalhh [aw=wt] 
tab totalhh [aw=wt] if g == 1
tab totalhh [aw=wt] if g == 2
tab totalhh [aw=wt] if g == 3
tab totalhh [aw=wt] if g == 4

tab Mortgage_payment [aw=wt] 
tab Mortgage_payment [aw=wt] if g == 1
tab Mortgage_payment [aw=wt] if g == 2
tab Mortgage_payment [aw=wt] if g == 3
tab Mortgage_payment [aw=wt] if g == 4

tab region  [aw=wt] 
tab region  [aw=wt] if g == 1
tab region  [aw=wt] if g == 2
tab region  [aw=wt] if g == 3
tab region  [aw=wt] if g == 4

//--- Last column of Panel A of Table A.1 one-way anova test ---
oneway Gender group if inlist(g,1,2,3,4)
oneway age group if inlist(g,1,2,3,4)
oneway above_bachelor group if inlist(g,1,2,3,4)
oneway Employed group if inlist(g,1,2,3,4) 
oneway Income group if inlist(g,1,2,3,4) & Income < 5 

oneway totalhh group if inlist(g,1,2,3,4) 
oneway totalhh group if inlist(g,1,2,3,4) & totalhh <= 5
oneway Mortgage_payment group  if inlist(g,1,2,3,4) 

oneway R1 group if inlist(g,1,2,3,4)
oneway R2 group if inlist(g,1,2,3,4)
oneway R3 group if inlist(g,1,2,3,4)
oneway R4 group if inlist(g,1,2,3,4)

// -------------------------------------------
// ------------------ Panel B ----------------
// -------------------------------------------
// ------First 4 columns of each row------
sum House_fut [aw=wt] 
sum House_fut [aw=wt] if g == 1 
sum House_fut [aw=wt] if g == 2
sum House_fut [aw=wt] if g == 3 
sum House_fut [aw=wt] if g == 4 

sum Mortgage_fut [aw=wt] 
sum Mortgage_fut [aw=wt] if g == 1 
sum Mortgage_fut  [aw=wt] if g == 2 
sum Mortgage_fut  [aw=wt] if g == 3 
sum Mortgage_fut  [aw=wt] if g == 4 

sum inf_fut [aw=wt] 
sum inf_fut [aw=wt] if g == 1 
sum inf_fut [aw=wt] if g == 2  
sum inf_fut [aw=wt] if g == 3 
sum inf_fut [aw=wt] if g == 4

sum FFR_curr_mid [aw=wt]
sum FFR_curr_mid [aw=wt] if g == 1
sum FFR_curr_mid [aw=wt] if g == 2
sum FFR_curr_mid [aw=wt] if g == 3
sum FFR_curr_mid [aw=wt] if g == 4

sum Mortgage_curr_mid [aw=wt] 
sum Mortgage_curr_mid [aw=wt] if g == 1
sum Mortgage_curr_mid [aw=wt] if g == 2
sum Mortgage_curr_mid [aw=wt] if g == 3
sum Mortgage_curr_mid [aw=wt] if g == 4

sum Inf_lag_mid [aw=wt]
sum Inf_lag_mid [aw=wt] if g == 1 
sum Inf_lag_mid [aw=wt] if g == 2
sum Inf_lag_mid [aw=wt] if g == 3
sum Inf_lag_mid [aw=wt] if g == 4

//--- Last column of Panel B of Table A.1 one-way anova test ---
oneway House_fut group  if inlist(g,1,2,3,4)
oneway Mortgage_fut group  if inlist(g,1,2,3,4)
oneway inf_fut group  if inlist(g,1,2,3,4)
oneway FFR_curr_mid group  if inlist(g,1,2,3,4)
oneway Mortgage_curr_mid group  if inlist(g,1,2,3,4)
oneway Inf_lag_mid group  if inlist(g,1,2,3,4)


// -------------------------------------------------------------
// ------------------------- Table A.2 -------------------------
// -------------------------------------------------------------
use "$sDIR/analysis_data_infor_provision.dta", clear
global ATE_control = "i.Gender i.Employment i.earn_q i.State region i.totalhh i.Marriage i.State i.region"

reg diff_House i.group , r
reg diff_House i.group  $ATE_control, r
reg diff_House_f i.group  if follow_up == 1, r
reg diff_House_f i.group  $ATE_control if follow_up == 1, r

global IS_control = "i.Gender i.Employment c.age##c.age i.Income i.colleage i.region totalhh i.Children i.Marriage"
global IS_control2 = "i.Gender i.Employment c.age##c.age i.Income i.colleage i.region totalhh i.Children i.Marriage House_certain FFR_fut House_fut2 Mortgage_fut"
// -------------------------------------------------------------
// ------------------------- Table A.3 -------------------------
// -------------------------------------------------------------
reg diff_House i.group  $IS_control [pw = wt] if Mortgage_payment == 1, r
reg diff_House i.group  $IS_control [pw = wt] if Mortgage_payment == 0, r
	
reg diff_House i.group  $IS_control [pw = wt] if colleage == 1, r
reg diff_House i.group  $IS_control [pw = wt] if colleage == 0, r

// -------------------------------------------------------------
// ------------------------- Table A.4 -------------------------
// -------------------------------------------------------------

//first stage effect
reg rev_ffr_first c.shock_ffr##i.group   FFR_curr_mid [pw=wt], r
reg rev_ffr_first c.shock_ffr##i.group   FFR_curr_mid $IS_control [pw=wt], r

// -------------------------------------------------------------
// ------------------------- Table A.5 -------------------------
// -------------------------------------------------------------
//tripple interaction with knowledge
reg diff_House c.shock_ffr##i.know_channel2##i.group  [pw=wt] if inlist(group,1,2,3,4), r

//test the difference in effect of shock between with and w/o knowledge in each treatment group
lincom _b[1.know_channel2#c.shock_ffr] + _b[1.know_channel2#2.group#c.shock_ffr]
lincom _b[1.know_channel2#c.shock_ffr] + _b[1.know_channel2#3.group#c.shock_ffr]
lincom _b[1.know_channel2#c.shock_ffr] + _b[1.know_channel2#4.group#c.shock_ffr]

reg diff_House c.shock_ffr##i.know_channel2##i.group  $IS_control [pw=wt] if inlist(group,1,2,3,4), r
//test the difference in effect of shock between with and w/o knowledge in each treatment group
lincom _b[1.know_channel2#c.shock_ffr] + _b[1.know_channel2#2.group#c.shock_ffr]
lincom _b[1.know_channel2#c.shock_ffr] + _b[1.know_channel2#3.group#c.shock_ffr]
lincom _b[1.know_channel2#c.shock_ffr] + _b[1.know_channel2#4.group#c.shock_ffr]

reg diff_House_f c.shock_ffr##i.know_channel2##i.group [pw=wt] if inlist(group,1,2,3,4), r
lincom _b[1.know_channel2#c.shock_ffr] + _b[1.know_channel2#2.group#c.shock_ffr]
lincom _b[1.know_channel2#c.shock_ffr] + _b[1.know_channel2#3.group#c.shock_ffr]
lincom _b[1.know_channel2#c.shock_ffr] + _b[1.know_channel2#4.group#c.shock_ffr]

reg diff_House_f c.shock_ffr##i.know_channel2##i.group $IS_control [pw=wt] if inlist(group,1,2,3,4), r
lincom _b[1.know_channel2#c.shock_ffr] + _b[1.know_channel2#2.group#c.shock_ffr]
lincom _b[1.know_channel2#c.shock_ffr] + _b[1.know_channel2#3.group#c.shock_ffr]
lincom _b[1.know_channel2#c.shock_ffr] + _b[1.know_channel2#4.group#c.shock_ffr]

// -------------------------------------------------------------
// ------------------------- Table A.6 -------------------------
// -------------------------------------------------------------
reg diff_House c.shock_ffr##c.House_conf   [pw=wt] if inlist(group,4), r
reg diff_House c.shock_ffr##c.House_conf   i.Mortgage_payment i.Ownership i.Gender i.Employment c.age i.earn_q i.colleage [pw=wt] if inlist(group,4), r
reg diff_House_f c.shock_ffr##c.House_conf   [pw=wt] if inlist(group,4), r
reg diff_House_f c.shock_ffr##c.House_conf   i.Mortgage_payment i.Ownership i.Gender i.Employment c.age i.earn_q i.colleage i.region [pw=wt] if inlist(group,4), r

// --------------------------------------------------------------
// ------------------------- Table A.7 --------------------------
// --------------------------------------------------------------
//Treatment effect on investment
reg revision_f i.group [pw=wt], r
reg revision_f i.group $IS_control [pw=wt], r

use "$sDIR/analysis_data_robust_wave.dta", clear
// --------------------------------------------------------------
// ------------------------- Table A.8 --------------------------
// --------------------------------------------------------------
global ind_contr = "pre_knowledge i.house_tenure i.mortgage i.gender i.employment i.marriage i.children i.hh_size head"
reg post_link i.group if inlist(group, 1,2,3,4,5), r
reg post_link i.group  i.house_tenure i.mortgage i.gender i.employment i.marriage i.children i.hh_size head if inlist(group, 1,2,3,4,5), r

reg diff_hp i.group if inlist(group, 1, 2, 3, 4, 5), r
reg diff_hp i.group diff_inf $ind_contr if inlist(group, 1, 2, 3, 4, 5), r

// --------------------------------------------------------------
// ------------------------- Table A.9 --------------------------
// --------------------------------------------------------------
reg diff_hp c.diff_ffr c.diff_inf##i.inflation_open pre_hp  if inlist(group, 4), r
reg diff_hp c.diff_ffr c.diff_inf##i.inflation_open pre_hp $ind_contr i.group if inlist(group, 4), r

use "$sDIR/analysis_data_non_verbal.dta", clear
// --------------------------------------------------------------
// ----------------------------- Table A.10 ---------------------
// --------------------------------------------------------------
//Number of observation:
tab group
//------------Panel A -----------
//First 4 columns of Panel A for each row
tab gender
tab gender if group == 0
tab gender if group == 1
tab gender if group == 2
tab gender if group == 3

sum age 
sum age if group == 0
sum age if group == 1
sum age if group == 2
sum age if group == 3

tab education 
tab education if group == 0
tab education if group == 1
tab education if group == 2
tab education if group == 3

tab marriage 
tab marriage if group == 0
tab marriage if group == 1
tab marriage if group == 2
tab marriage if group == 3

sum employed_stat 
sum employed_stat if group == 0
sum employed_stat if group == 1
sum employed_stat if group == 2
sum employed_stat if group == 3

//monthly income < $5,000 => annual income < $60,000 
tab income  
tab income  if group == 0
tab income  if group == 1
tab income  if group == 2
tab income  if group == 3

tab mortgage_payment  
tab mortgage_payment  if group == 0
tab mortgage_payment  if group == 1
tab mortgage_payment  if group == 2
tab mortgage_payment  if group == 3

tab region
tab region  if group == 0
tab region  if group == 1
tab region  if group == 2
tab region  if group == 3

// -------------------------------
//------------Panel B -----------
// -------------------------------
//First 4 columns of Panel A for each row
sum pre_house 
sum pre_house if group == 0
sum pre_house if group == 1
sum pre_house if group == 2
sum pre_house if group == 3

sum pre_interest
sum pre_interest if group == 0
sum pre_interest if group == 1
sum pre_interest if group == 2
sum pre_interest if group == 3

sum pre_inf
sum pre_inf if group == 0
sum pre_inf if group == 1
sum pre_inf if group == 2
sum pre_inf if group == 3

sum pre_interest_nov
sum pre_interest_nov if group == 0
sum pre_interest_nov  if group == 1
sum pre_interest_nov if group == 2
sum pre_interest_nov if group == 3

// //Last column of Panel  for each row
// oneway  pre_house   group 
// oneway  pre_interest   group 
// oneway  pre_inf  group 
// oneway  pre_interest_nov  group 

// -------------------------------------------------------
// ---------------------- Table A.11 ---------------------
// -------------------------------------------------------
global ind_contr = "i.gender i.employment c.age##c.age i.income i.education i.region i.child i.mortgage_payment i.ownership"
//column 1
reg diff_house ib(0).group , r
//test below column 1
test i1.group = i2.group
test i2.group = i3.group

//column 2
reg diff_house ib(0).group $ind_contr, r
//test below column 2
test i1.group = i2.group
test i2.group = i3.group

//column 3
reg diff_house_f ib(0).group , r
//test below column 3
test i1.group = i2.group
test i2.group = i3.group

//column 4
reg diff_house_f ib(0).group $ind_contr, r
//test below column 4
test i1.group = i2.group
test i2.group = i3.group


// -------------------------------------------------------
// ---------------------- Table A.12 ---------------------
// -------------------------------------------------------

foreach var in AC1 AC2 AC3 {
//group == 1 (text treatment)
	tab `var'	if group == 1
//group == 2 (audio treatment)	
	tab `var'	if group == 2
//group == 3 (video treatment)		
    tab `var'	if group == 3
}

use "$sDIR/analysis_data_robust_wave.dta", clear
// --------------------------------------------------------------
// ------------------------- Table A.13 -------------------------
// --------------------------------------------------------------
global ind_contr = "i.gender i.employment pre_knowledge i.house_tenure i.mortgage i.marriage i.children i.hh_size head"
//column 1
reg diff_hp i.group if inlist(group,1,6,7,8,9),r
//test statistics below
//voice
test i6.group = i7.group 
test i8.group = i9.group 
//face
test i6.group = i9.group 
test i7.group = i8.group 

//column 2
reg diff_hp i.group $ind_contr if inlist(group,1,6,7,8,9),r
//test statistics below
//voice
test i6.group = i7.group 
test i8.group = i9.group 
//face
test i6.group = i9.group 
test i7.group = i8.group 

// --------------------------------------------------------------
// ------------------------- Table A.14 -------------------------
// --------------------------------------------------------------
//column 1
reg diff_hp c.script c.voice c.body  c.script_aggre#c.shock_mp c.voice_aggre#c.shock_mp c.body_aggre#c.shock_mp shock_mp if inlist(group,1,6,7,8,9) & hp_better != 1, r 
//column 2
reg diff_hp c.script c.voice c.body  c.script_aggre#c.shock_mp c.voice_aggre#c.shock_mp c.body_aggre#c.shock_mp shock_mp $ind_contr if inlist(group,1,6,7,8,9) & hp_better != 1, r 
//column 3
reg diff_hp c.script c.voice c.body  c.script_aggre#c.shock_mp c.voice_aggre#c.shock_mp c.body_aggre#c.shock_mp shock_mp if inlist(group,1,6,7,8,9) & hp_better == 1, r
//column 4
reg diff_hp c.script c.voice c.body  c.script_aggre#c.shock_mp c.voice_aggre#c.shock_mp c.body_aggre#c.shock_mp shock_mp $ind_contr if inlist(group,1,6,7,8,9) & hp_better == 1, r

// --------------------------------------------------------------
// ------------------------- Table A.15 -------------------------
// --------------------------------------------------------------

//       N/A (purely descriptive table)

// --------------------------------------------------------------
// ------------------------- Table A.16 -------------------------
// --------------------------------------------------------------
use "$sDIR/analysis_vignette_pooled.dta", clear
// ----------Internal validation -------------
reg  mec1 mec1_open,  r
probit mec1 mec1_open,  r
margins, dydx(*) atmeans

// --------------------------------------------------------------
// ------------------------- Table A.17 -------------------------
// --------------------------------------------------------------
// ---------------- Pooled sample analysis ------------------
//use "$sDIR/analysis_vignette_pooled.dta", clear
global ind_contr = "i.gender i.employment c.age i.income i.colleage i.region"

//Overall - columns 1 and 2
probit mec1 ib1.ex1_3 [pw=wt], r
margins, dydx(*) atmeans
probit mec1 ib1.ex1_3  $ind_contr [pw=wt], r
margins, dydx(*) atmeans
//Demand-side channel - columns 3 and 4
probit mec1 ib1.ex1_3 [pw=wt] if sd == 1, r
margins, dydx(*) atmeans
probit mec1 ib1.ex1_3 $ind_contr [pw=wt] if sd == 1, r
margins, dydx(*) atmeans
//Supply-side channel - columns 5 and 6
probit mec1 ib1.ex1_3  [pw=wt] if sd == 2, r
margins, dydx(*) atmeans
probit mec1 ib1.ex1_3 $ind_contr [pw=wt] if sd == 2, r
margins, dydx(*) atmeans
//Inflation channel - columns 7 and 8
probit mec1 ib1.ex1_3  [pw=wt] if sd == 3, r
margins, dydx(*) atmeans
probit mec1 ib1.ex1_3 $ind_contr [pw=wt] if sd == 3, r
margins, dydx(*) atmeans


use "$sDIR/analysis_data_pooled.dta", clear
// --------------------------------------------------------------
// ----------------------------- Table A.18 ---------------------
// --------------------------------------------------------------
reg know_channel2 i.Gender Education Income age i.Mortgage_payment i.Marriage i.Employed  i.Children i.Ownership, r 
reg know_channel2 i.Gender Education Income age i.Mortgage_payment i.Marriage i.Employed  i.Children i.Ownership i.wave i.platform, r 

// --------------------------------------------------------------------------------------------------
// -------------------------------------------Appendix Figures --------------------------------------
// --------------------------------------------------------------------------------------------------
// --------------------------------------------------------------
// ------------------------- Figure A1  -------------------------
// --------------------------------------------------------------

// N/A (tikz figure)

// --------------------------------------------------------------
// ------------------------- Figure A2 - Matlab code ------------
// --------------------------------------------------------------
// reproduce using ".../figures/FigureA2_plot.m"

// --------------------------------------------------------------
// ------------------------- Figure A3 - Matlab code ------------
// --------------------------------------------------------------
// reproduce using ".../figures/FigureA3_plot.m"

// --------------------------------------------------------------
// ------------------------- Figure A4 - Matlab code ------------
// --------------------------------------------------------------
// reproduce using ".../figures/FigureA4_plot.m"
